By default, the Windows SMTP server does not allow relaying. In order for your application to send emails, you must enable relaying to the computer itself. This solution opens up relaying to the local server 127.0.0.1 only, so it is not open to everyone. The 127.0.0.1 is a local non-routable address that designates the machine you are using. This instruction and images describe the process for IIS v6, for other versions please refer to Microsoft documentation, such as http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/configure-smtp-e-mail-in-iis-7-and-above for IIS 7.5. The process logically is the same, but IIS UI is different
Step 1: Open the IIS Console (Start -> Settings -> Control Panel -> Administrative Tools -> Internet Information Services)
Step 2: On the left pane of the IIS Console, expand the computer icon.
Step 3: Right click on "Default SMTP Virtual Server" and select Properties.
Step 4: In the Properties dialog, select the Access Tab.
Step 5: Select “Relay…”.
Step 6: In the Relay Restriction dialog, add the IP Address of your system. Make sure the "Only the list below" option is selected. This will effectively allow your machine to communicate with its own SMTP server so emails can be sent.
Step 7: Click OK to accept the changes.
Step 8: Click OK until you've closed all the dialogs. Your application can now send emails.
|